import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopUserCouponsController } from '../../../controllers';
const uctoominishopUserCouponsRouter = new Router();
const minishopUserCouponsController = new uctooMinishopUserCouponsController();

uctoominishopUserCouponsRouter.post('/add', requireUser, minishopUserCouponsController.add);
uctoominishopUserCouponsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_user_coupons'), minishopUserCouponsController.edit);
uctoominishopUserCouponsRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_user_coupons'), minishopUserCouponsController.delete);

//For getting minishopUserCoupons with permission control
uctoominishopUserCouponsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_user_coupons'), minishopUserCouponsController.getSingle);
uctoominishopUserCouponsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_user_coupons'), minishopUserCouponsController.getMany);
uctoominishopUserCouponsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_user_coupons'), minishopUserCouponsController.getMany);

//#endregion AutoCreateCode
export default uctoominishopUserCouponsRouter;
